<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript">
			window.onload = function() {
				var baidu = document.getElementsByTagName("a")[0];
				console.log(baidu.href);
				console.log(baidu.target);
				console.log(baidu.className);
				console.log(baidu.addr);//undefined
				console.log(baidu.getAttribute("href"));
				console.log(baidu.getAttribute("target"));
				console.log(baidu.getAttribute("class"));
				console.log(baidu.getAttribute("addr"));
			}
			
			function f1 () {
				var baidu = document.getElementsByTagName("a")[0];
				baidu.href = "http://www.163.com";
				baidu.target = "_self";
				baidu.addr = "qingdao";
				baidu.setAttribute("addr", "shanghai");
				baidu.setAttribute("height", "180");
			}
		</script>
	</head>
	<body>
		<a href="http://www.baidu.com" addr="beijing" target="_blank" class="apple">百度</a> 
	    <br/>
	    <input type="button" onclick="f1()" value="修改属性"/>
	</body>
</html>
